import 'dart:async';

import 'package:flutter_test/flutter_test.dart';
import 'package:hc_bio_sdk/hc_bio_sdk.dart';
import 'package:hc_bio_sdk/hc_bio_sdk_platform_interface.dart';
import 'package:hc_bio_sdk/hc_bio_sdk_method_channel.dart';
import 'package:hc_bio_sdk/model/rr.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockHcBioSdkPlatform
    with MockPlatformInterfaceMixin
    implements HcBioSdkPlatform {
  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future append(RRModel rr) {
    // TODO: implement append
    throw UnimplementedError();
  }

  @override
  Future initialize(String channelCode) {
    // TODO: implement initialize
    throw UnimplementedError();
  }

  @override
  Future login({required String userID}) {
    // TODO: implement login
    throw UnimplementedError();
  }

  @override
  // TODO: implement dataStream
  StreamController get dataStream => throw UnimplementedError();
}

void main() {
  final HcBioSdkPlatform initialPlatform = HcBioSdkPlatform.instance;

  test('$MethodChannelHcBioSdk is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelHcBioSdk>());
  });

  test('getPlatformVersion', () async {
    HcBioSdk hcBioSdkPlugin = HcBioSdk();
    MockHcBioSdkPlatform fakePlatform = MockHcBioSdkPlatform();
    HcBioSdkPlatform.instance = fakePlatform;

    expect(await hcBioSdkPlugin.getPlatformVersion(), '42');
  });
}
